package com.ywl.task.service.impl;

import com.ywl.task.mapper.ConsoleMapper;
import com.ywl.task.pojo.Console;
import com.ywl.task.service.ConsoleService;
import com.ywl.task.util.pojo.QdResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author 严伟伦
 * @Company 无
 * @Description
 * @Date: 2024/9/11 20:08
 */
@Service
public class ConsoleServiceImpl implements ConsoleService {
    @Autowired
    private ConsoleMapper consoleMapper;
    @Override
    public QdResult count(Long userId) {
        Console count = new Console();
        count.setCountProjects(consoleMapper.countProjects());
        count.setCountMyProjects(consoleMapper.countMyProjects(userId));
        count.setCountMyTaskStatus(consoleMapper.countMyTaskStatus(userId,4));
        count.setCountMyTaskNoStatus(consoleMapper.countMyTaskStatus(userId,3));
        return QdResult.success(count);
    }
}
